<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>FCKeditorAPI</title>
	<script type="text/javascript">

var InstanceCounter = 0 ;


function CreateInstance()
{
	var oIFrame = document.createElement( 'iframe' ) ;
	oIFrame.width = '100%' ;
	oIFrame.height = 100 ;
	oIFrame.src = 'test1_inner.html' ;

	document.getElementById( 'xInstances' ).appendChild( oIFrame ) ;
}

function UpdateInfo()
{
	try
	{
		document.getElementById( 'xFCKeditorAPI' ).innerHTML = typeof( FCKeditorAPI ) ;

		var iCount = 0 ;
		var sInstances = '' ;

		for ( var s in FCKeditorAPI.Instances )
		{
			iCount++ ;

			if ( sInstances.length > 0 )
				sInstances += ', ' ;
			sInstances += s ;
		}

		document.getElementById( 'xCount').innerHTML = iCount ;
		document.getElementById( 'xInstanceNames').innerHTML = sInstances ;
	}
	catch (e) {}
}

function RemoveFirstInstance()
{
	var eInstances = document.getElementById( 'xInstances' ) ;
	if ( !eInstances.firstChild )
	{
		alert( 'There are no instances to remove' ) ;
		return ;
	}

	eInstances.removeChild( eInstances.firstChild ) ;
}


	</script>
</head>
<body>
	<h1>
		FCKeditorAPI</h1>
	<p>
		Click the following button to create instances:
	</p>
	<p>
		<input type="button" value="Create Instance" onclick="CreateInstance();" />
		<input type="button" value="Remove First Instance" onclick="RemoveFirstInstance();" />
	</p>
	<hr />
	<p>
		<input type="button" value="Update FCKeditorAPI Info" onclick="UpdateInfo();" />
	</p>
	<p>
		TypeOf FCKeditorAPI: <span id="xFCKeditorAPI"></span> (must be "object")
		<br />
		Number of Instances: <span id="xCount"></span>
		<br />
		Instances: <span id="xInstanceNames"></span>
	</p>
	<hr />
	<div id="xInstances"></div>
</body>
</html>
